<?php
foreach($partnerlang as $langkey=>$langval){
    $title[$langkey] = (set_value('title'.$langkey) == '')?$reviewsdetails['title'.$langkey]:set_value('title'.$langkey);
}
$status = (set_value('status') == '')?$reviewsdetails['status']:set_value('status');

$id = ($this->input->post('id') == '')?$reviewsdetails['reviews_id']:$this->input->post('id');
$action=(($reviewsdetails['id'] || $this->input->post('id')!='')?"doaddreviews":"doaddreviews");
?>
<?php
//$set_txtContactName = (set_value('txtContactName') == '')?$hoteldetails['txtContactName']:set_value('txtContactName');
?>
<div class="form_content">
    <header><h3>Add New reviews</h3></header>
    <div class="module_content">
        <?php if($image_deleted):?>
        <div class="error"><?php echo $image_deleted; ?></div>
        <?php endif;?>
        <?php //echo validation_errors(); ?>
        <form name="reviewsform" id="reviewsform"  action="<?php echo base_url(); ?>secu/reviews/<?php echo $action;?>" method="post" onsubmit="return validateForm()" >
        <input type="hidden" name="id" id="id" value="<?php echo $id; ?>">        
        <?php foreach($partnerlang as $langkey=>$langval):?>
        <fieldset>          
            <label> reviews Title (<?php echo $langval;?>)</label>
            <textarea rows="4" name="title<?php echo $langkey?>" id="title<?php echo $langkey?>" /><?php echo $title[$langkey] ?></textarea>            
        </fieldset>
        <?php endforeach;?>        
        <fieldset style="width:40%;">
            <label style="width: 10%;">Status</label>
            <input <?php echo ($status==1)?"checked":""; ?> type="checkbox" name="status" value="1" style="width:20%;">
             <?php echo form_error('status'); ?>
        </fieldset>
        <fieldset>
            <input type="submit" name="submit" id="submit" value="SAVE"  >&nbsp;
            <input type="reset" name="reset" id="reset" value="RESET" >
        </fieldset>
        
        <div class="clear"></div>
        </form>
        <?php if ($id!=''):?>
        <div class="clear"></div>
        <form enctype="multipart/form-data" id="fupload" method="post" action="<?php echo base_url(); ?>secu/reviews/savereviewsimages/reviewsimg">
            <input type="hidden" name="id" value="<?php echo $id;?> " id="id">
            <input type="hidden" name="upload_from" value="reviewsimg" id="upload_from">
            <a name="img"></a>
            <fieldset style="width:50%; float:left; padding: 10px 0 10px 10px;">
            <input name="userfile" type="file" size="40"/>
            <input type="submit" name="btn_upload" value="Upload &uarr;" class="btnupload"/>
            </fieldset>
            <?php if (isset ($imgerror)) { ?>
            <div class="error"><?php echo $imgerror; ?></div>
            <?php } ?>

        </form>
        <div class="clear"></div>
        <fieldset style="padding: 10px; width:200px">
        <?php if($reviewsdetails['image']) { ?>

                    <div class="imgbox">
                        <a class=""  href="<?php echo base_url(); ?>images/uploads/original/<?php echo $reviewsdetails['image'] ?>">
                        <img class="thumb" name="thumb" id="" src="<?php echo base_url(); ?>images/uploads/thumb/thumb_<?php echo $reviewsdetails['image'] ?>"/>
                        </a>
                        <div>
                            <a class="adel" href="<?php echo base_url()?>secu/reviews/deletereviewsimage/name/<?php echo $reviewsdetails['image']; ?>/id/<?php echo $reviewsdetails["reviews_id"] ;?>">
                            <img src="<?php echo base_url(); ?>images/admin/icn_trash.png" title="Trash">delete
                            </a>
                        </div>
                    </div>

                <?php } ?>
            </fieldset>
                <div class="clear"></div>
        <?php endif; ?>        
    </div>



</div>



